package br.com.obardavez.web;

import javax.ws.rs.core.MediaType;

import com.google.inject.Singleton;
import com.sun.jersey.api.core.ResourceConfig;
import com.sun.jersey.spi.container.WebApplication;
import com.sun.jersey.spi.container.servlet.ServletContainer;

@Singleton
public class JerseyServletContainer extends ServletContainer {

    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override

    public void initiate(ResourceConfig rc, WebApplication wa ) {

        super.initiate(rc, wa);

        rc.getMediaTypeMappings().put("json", MediaType.valueOf("application/json"));
        
        rc.getMediaTypeMappings().put("javascript", MediaType.valueOf("application/javascript"));

        rc.getMediaTypeMappings().put("xml", MediaType.valueOf("application/xml"));

        rc.getMediaTypeMappings().put("js", MediaType.valueOf("text/javascript"));
        
        rc.getMediaTypeMappings().put("urlencoded", MediaType.valueOf("application/x-www-form-urlencoded"));
        

    }

}
